<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/jquery-1.12.4.js"></script>
</head>
<body>

    <button id="btn" type="button">加载数据</button>
    <p/>

    <table id="tbl" border="1" align="left" width="50%">
        <thead>
            <tr>
                <td>序号</td>
                <td>姓名</td>
                <td>密码</td>
            </tr>
        </thead>

        <tbody>

        </tbody>
    </table>
    <script>
        $("#btn").click(function(){
            $.get('getUserList.do',function( res ){
                // console.log(typeof res )
                // console.log( res )
                $.each(res,function(index,obj){
                    let tr = $("<tr></tr>") ;

                    let td1 = $("<td>" + (index + 1) + "</td>")
                    let td2 = $("<td>" + obj.username + "</td>")
                    let td3 = $("<td>" + obj.password + "</td>")

                    tr.append(td1).append(td2).append(td3)

                    $("#tbl tbody").append(tr) ;
                })
            })
        })




    </script>


</body>
</html>